package com.bwie.controller;

import com.bwie.config.PayConfig;
import com.bwie.pojo.TbOrder;
import com.bwie.service.TbOrderService;
import com.bwie.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@RestController
@RequestMapping("/order/order")
public class OrderController {



    @Autowired
    TbOrderService tbOrderService;

    @Autowired
    PayConfig payConfig;

    @PostMapping("/SaveOrder")
    public Result SaveOrder(@RequestBody TbOrder tbOrder){

        return tbOrderService.SaveOrder(tbOrder);
    }

    @PostMapping("/OrderList")
    public Result OrderList(){

        return tbOrderService.OrderList();
    }



    @GetMapping("/PayOrder/{orderCode}")
    public void PayOrder(@PathVariable("orderCode") String orderCode) throws IOException {

        tbOrderService.PayOrder(orderCode);
    }

}
